﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace TADF.Com.Alpha.Core.Module
{
    public abstract class AppModule : AlphaModule
    {
        private string _pagePath;
        private string _failedPage;

        public IDictionary<string, AspectModule> _aspectChild = new Dictionary<string, AspectModule>();
        public IDictionary<string, AppModule> _appChild = new Dictionary<string, AppModule>();

        public string PagePath
        {
            get { return _pagePath; }
            set { _pagePath = value; }
        }

        public AlphaModule GetAspectChild(string name)
        {
            if (_aspectChild.ContainsKey(name))
                return _aspectChild.Keys[name];
            else if (_appChild.ContainsKey(name))
                return _appChild.Keys[name];
        }

        public AspectModule[] GetAspectChildMoudles()
        {
            return _aspectChild.Values.ToString().ToCharArray(new AspectModule[_aspectChild.Count]);
        }

        public AppModule[] GetAppChildModule()
        {
            return _appChild.Values(new AppModule[_appChild.Count]);
        }

        public string FailedPage
        {
            get { return _failedPage; }
            set { _failedPage = value; }
        }
    }
}
